Spread for ASP.NET 8.0 Product Documentation
TagCloudCellType Constructor(String[],String[],String[])
Example 


Items for the cloud specified in a string array
Weights for the cloud items specified in a string array
HTML anchors for the cloud items specified in a string array
Creates a new tag cloud cell with the specified items, weights, and hrefs.
Syntax
'Declaration
 
Public Function New( _
   ByVal items() As String, _
   ByVal weights() As String, _
   ByVal hrefs() As String _
)
'Usage
 
Dim items() As String
Dim weights() As String
Dim hrefs() As String
 
Dim instance As New TagCloudCellType(items, weights, hrefs)
public TagCloudCellType( 
   string[] items,
   string[] weights,
   string[] hrefs
)

Parameters

items
Items for the cloud specified in a string array
weights
Weights for the cloud items specified in a string array
hrefs
HTML anchors for the cloud items specified in a string array
Example
This example shows the creation of new tag cloud cells.
      // Use first tag cloud cell type constructor.
      FarPoint.Web.Spread.TagCloudCellType tagCell = new FarPoint.Web.Spread.TagCloudCellType();
      tagCell.DataSource = GetData();//refer to the data source part.
      tagCell.DataTextField = "Name";
      tagCell.DataWeightField = "Weight";
      tagCell.DataTitleField = "University";
      tagCell.DataHrefField = "Favorite site";
      tagCell.DataTextFormatString = "UserName:{0}";
      tagCell.DataTitleFormatString = "Graduate from:[{0}]";
      tagCell.DataHrefFormatString = "http://{0}";
      tagCell.DataDisplayTextField = "University";
      tagCell.DataItemDataField = "Weight";
      FpSpread1.ActiveSheetView.Cells[0, 0].CellType = tagCell;
      // Use second tag cloud cell type constructor.
      FarPoint.Web.Spread.TagCloudCellType tagCell1 = new FarPoint.Web.Spread.TagCloudCellType(new string[] { "SEARCH", "ASP.NET",
"JAVASCRIPT" }, new string[] { "20", "50", "30" });
      FpSpread1.ActiveSheetView.Cells[1, 0].CellType = tagCell1;
      // Use third tag cloud cell type constructor.
      FarPoint.Web.Spread.TagCloudCellType tagCell2 = new FarPoint.Web.Spread.TagCloudCellType(new string[] { "SEARCH", "ASP.NET",
"JAVASCRIPT" }, new string[] { "20", "50", "30" }, new string[] { "http://www.google.com", "http://gcdn.grapecity.com/cs/tags/ASP.NET/default.aspx",
"http://gcdn.grapecity.com/cs/tags/JavaScript/default.aspx" });
      FpSpread1.ActiveSheetView.Cells[2, 0].CellType = tagCell2;
    }

private DataTable GetData()
    {
      DataTable table = new DataTable("Demo");
      table.Columns.Add("ID", typeof(int));
      table.Columns.Add("Name", typeof(string));
      table.Columns.Add("University", typeof(string));
      table.Columns.Add("Favorite site", typeof(string));
      table.Columns.Add("Weight", typeof(int));
      table.Rows.Add(new object[] { 1, "Spread User", "FarPoint", "www.clubfarpoint.com", 20 });
      table.Rows.Add(new object[] { 2, "Google User", "Google", "www.google.com", 3 });
      table.Rows.Add(new object[] { 3, "Microsoft Developer", "Microsoft", "www.microsoft.com", 1 });
      table.Rows.Add(new object[] { 4, "Code Project User", "CodeProject", "www.codeproject.com", 10 });
      return table;
    }
' Use first tag cloud cell type constructor.
Dim tagCell As New FarPoint.Web.Spread.TagCloudCellType()
tagCell.DataSource = GetData() 'refer to the data source part.
tagCell.DataTextField = "Name"
tagCell.DataWeightField = "Weight"
tagCell.DataTitleField = "University"
tagCell.DataHrefField = "Favorite site"
tagCell.DataTextFormatString = "UserName:{0}"
tagCell.DataTitleFormatString = "Graduate from:{0}"
tagCell.DataHrefFormatString = "http://{0}"
tagCell.DataDisplayTextField = "University"
tagCell.DataItemDataField = "Weight"
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = tagCell '

' Use second tag cloud cell type constructor.
Dim tagCell1 As New FarPoint.Web.Spread.TagCloudCellType(New String() {"SEARCH", "ASP.NET", "JAVASCRIPT"}, New String() {"20",
"50", "30"})
FpSpread1.ActiveSheetView.Cells(1, 0).CellType = tagCell1 '

' Use third tag cloud cell type constructor.
Dim tagCell2 As New FarPoint.Web.Spread.TagCloudCellType(New String() {"SEARCH", "ASP.NET", "JAVASCRIPT"}, New String() {"20",
"50", "30"}, New String() {"http://www.google.com", "http://gcdn.grapecity.com/cs/tags/ASP.NET/default.aspx", "http://gcdn.grapecity.com/cs/tags/JavaScript/default.aspx"})
FpSpread1.ActiveSheetView.Cells(2, 0).CellType = tagCell2 '

Private Function GetData() As DataTable
   Dim table As New DataTable("Demo")
   table.Columns.Add("ID", GetType(Integer))
   table.Columns.Add("Name", GetType(String))
   table.Columns.Add("University", GetType(String))
   table.Columns.Add("Favorite site", GetType(String))
   table.Columns.Add("Weight", GetType(Integer))
   table.Rows.Add(New Object() {1, "Spread User", "FarPoint", "www.clubfarpoint.com", 20})
   table.Rows.Add(New Object() {2, "Google User", "Google", "www.google.com", 3})
   table.Rows.Add(New Object() {3, "Microsoft Developer", "Microsoft", "www.microsoft.com", 1})
   table.Rows.Add(New Object() {4, "Code Project User", "CodeProject", "www.codeproject.com", 10})
   Return table
End Function 'GetData
Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

TagCloudCellType Class
TagCloudCellType Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.